//
// Created by 匡涂上青 on 2021/8/24.
//

#include "test.h"
#include <kgl.h>
#include <iostream>

int model_loader_test_main() {
    kgl::Log::Init();
    auto loader = SGT_MODEL_LOADER();
    auto fileName = "../kgl-data/model/peco/peco.obj";
    if (loader->pre_load(fileName, "mari")) {
        auto model = loader->load("mari");
        kgl::Log::Trace("Model '{0}' at '{1}'", "mari", model->path);
        for (auto &mesh : model->meshes) {
            kgl::Log::Trace("mesh '{0}', {1} vertices", mesh->name.c_str(), mesh->vertex_num);
            for (size_t i = 0; i < mesh->textures.size(); i++) {
                kgl::Log::Trace("Texture '{0}': {1}x{2}", i, mesh->textures[i]->width, mesh->textures[i]->height);
            }
        }
    } else {
        //kgl::Log::Info("Model load failed");
    }

    return 0;
}